package com.example.t410.controller;

import com.example.t410.dao.NootbookResult;
import com.example.t410.service.KnowledgeService;
import com.example.t410.VO.KnowledgeVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@Slf4j
@RequestMapping("/knowledge")
public class KnowledgeController {

    @Autowired
    KnowledgeService knowledgeService;

    /**
     * 知识科普查询
     * @return
     */
    @GetMapping
    public NootbookResult select(){
        log.info("知识科普查询");
        List<KnowledgeVO> list=knowledgeService.selectAll();
        return NootbookResult.Success(list);
    }

}
